package com.wwtech.epp.ui.activity.friend.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.friend.FrameworkActivity;
import com.wwtech.epp.ui.activity.friend.contract.FrameworkContract;
import com.wwtech.epp.ui.activity.friend.presenter.FrameworkPresenter;
import com.wwtech.epp.ui.adapter.work.FrameworkAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.friend
 * @Description: The moduele of FrameworkActivity, provide field for FrameworkActivity
 * @date 2017/10/24 20:19:32
 */
@Module
public class FrameworkModule {
    private final FrameworkContract.View mView;


    public FrameworkModule(FrameworkContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public FrameworkPresenter provideFrameworkPresenter(HttpAPIWrapper httpAPIWrapper, FrameworkActivity mActivity) {
        return new FrameworkPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public FrameworkActivity provideFrameworkActivity() {
        return (FrameworkActivity) mView;
    }
    @Provides
    @ActivityScope
    public FrameworkAdapter provideFrameworkAdapter() {
        return new FrameworkAdapter(new ArrayList<>());
    }
}